//
//  ZYUserView.m
//  Tourism
//
//  Created by 张亚 on 16/2/20.
//  Copyright © 2016年 zhangya. All rights reserved.
//

#import "ZYUserView.h"

@interface ZYUserView ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation ZYUserView

- (void)userTableView{

    UITableView * tab = [[UITableView alloc]initWithFrame:self.bounds style:UITableViewStylePlain];
    tab.delegate = self;
    tab.dataSource = self;
    [self addSubview:tab];
    tab.rowHeight = 80;
    
    UIView * headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 200, 100)];
    headerView.backgroundColor = [UIColor yellowColor];
    UILabel * userTitle = [[UILabel alloc]initWithFrame:CGRectMake(50, 20, 50, 50)];
    userTitle.backgroundColor = [UIColor redColor];
    [headerView addSubview:userTitle];
    tab.tableHeaderView = headerView;

}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 50;

}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString * cellID = @"cell";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    if (indexPath.row == 0) {
        cell.imageView.image = [UIImage imageNamed:@"添加"];
        cell.textLabel.text = @"添加";
    }else if (indexPath.row == 1) {
        cell.imageView.image = [UIImage imageNamed:@"收藏"];
        cell.textLabel.text = @"我的收藏";
    }else if (indexPath.row == 2) {
        cell.imageView.image = [UIImage imageNamed:@"设置"];
        cell.textLabel.text = @"设置";
    }else if (indexPath.row == 3) {
        cell.imageView.image = [UIImage imageNamed:@"退出登录"];
        cell.textLabel.text = @"退出登录";
    }
    return cell;
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    NSLog(@"dianji");
}

@end
